// <copyright file="EasyWebApp.cs" company="<Customer Name>">This is a "work-for-hire". or Copyright (C) 2010 MicroCODE Incorporated Troy, MI</copyright><author><Class Author's Name></author>

/*
 *      Title:    <Class Description>
 *      Module:   ClassTemplate (<Namespace>:ClassTemplate.cs)
 *      Project:  <Project Name>
 *      Customer: <Customer Name>
 *      Facility: MicroCODE Incorporated
 *      Date:     <Class Creation Date>
 *      Author:   <Class Author's Name>
 * 
 * 
 * 
 *  
 *      MODIFICATIONS:
 *      --------------
 *
 *  Date:         By-Group:   Rev:     Description:
 *
 *  DD-Mmm-YYYY   XYZ-GROUP  {0001}    Describe reason for creating or modifying class... 
 * 
 * 
 * 
 */
using System.Collections.Specialized;
using System.Web;
using System.Web.SessionState;
using Org.EasyWeb.Sys;

namespace Org.EasyWeb.Data
{
    public sealed class GlobalVariable
    {
        // Fields
        public const string ApplicationData = "GlobalApplication";
        public static IGlobalVariable Current;
        public const string SessionData = "GlobalSession";

        // Methods
        private GlobalVariable()
        {
        }

        // Properties
        public static IAppGlobal AppGbl
        {
            get
            {
                return Current.AppGbl;
            }
        }

        public static NameObjectCollectionBase Application
        {
            get
            {
                return Current.Application;
            }
        }

        public static IUserInfo Info
        {
            get
            {
                return SessionGbl.Info;
            }
        }

        public static RegsCollection RegsCollection
        {
            get
            {
                return AppGbl.RegsCollection;
            }
        }

        public static HttpRequest Request
        {
            get
            {
                return Current.Request;
            }
        }

        public static HttpResponse Response
        {
            get
            {
                return Current.Response;
            }
        }

        public static HttpServerUtility Server
        {
            get
            {
                return Current.Server;
            }
        }

        public static HttpSessionState Session
        {
            get
            {
                return Current.Session;
            }
        }

        public static ISessionGlobal SessionGbl
        {
            get
            {
                return Current.SessionGbl;
            }
        }

        public static object UserID
        {
            get
            {
                return Info.UserID;
            }
        }
    }
}
